home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 November / PCWNOV08.iso / Software / Freeware / Notepad 5.0.1 / npp.5.0.1.Installer.exe / plugins / doc / NppExec_TechInfo.txt < prev    next >
Encoding:
Text File  |  2008-02-06  |  7.5 KB  |  208 lines

  1.  ****************************************************************************
  2.  * NppExec plugin ver. 0.2 for Notepad++ 4.3 (and above)
  3.  * by DV, December 2006 - February 2008
  4.  ****************************************************************************
  5.  
  6.  
  7.  ***************************
  8.  *  Technical Information  *
  9.  ***************************
  10.  
  11.  NppExec has advanced "hidden" settings which can be set manually.
  12.  You need to edit NppExec's ini-file: "\Plugins\Config\NppExec.ini".
  13.  
  14.   --------------------------------------------------------------
  15.  |  KEY                             |  DEFAULT VALUE   |  TYPE  |
  16.  |--------------------------------------------------------------|
  17.  |                                  |                  |        |
  18.  |  [Console]                       |                  |        |
  19.  |  ChildProcess_StartupTimeout_ms  |  240             |  int   |
  20.  |  ChildProcess_CycleTimeout_ms    |  120             |  int   |
  21.  |  Path_AutoDblQuotes              |  0      (FALSE)  |  BOOL  |
  22.  |  CmdHistory_MaxItems             |  256             |  int   |
  23.  |  Exec_MaxCount                   |  100             |  int   |
  24.  |  RichEdit_MaxTextLength          |  4194304 (4 MB)  |  int   |
  25.  |  CommentDelimiter                |  //              | string |
  26.  |  Visible                         |  0      (FALSE)  |  BOOL  |
  27.  |  NoEmptyVars                     |  1      (TRUE)   |  BOOL  |
  28.  |  SaveCmdHistory                  |  1      (TRUE)   |  BOOL  |
  29.  |                                  |                  |        |
  30.  |  [Options]                       |                  |        |
  31.  |  HotKey                          |  F6              | string |
  32.  |  ToolbarBtn                      |  1               |  int   |
  33.  |  WatchScriptFile                 |  1      (TRUE)   |  BOOL  |
  34.  |                                  |                  |        |
  35.   --------------------------------------------------------------
  36.  
  37.  The purpose of each key is described below.
  38.  You can add specified keys to [Console] or [Options] section of 
  39.  this ini-file.
  40.  For example, you can modify it in the following way:
  41.  
  42.    [Options]
  43.    HotKey=F6
  44.    ToolbarBtn=1
  45.    WatchScriptFile=1
  46.    
  47.    [Console]
  48.    Visible=0
  49.    OEM=1
  50.    CmdHistory=1
  51.    ChildProcess_StartupTimeout_ms=240
  52.    ChildProcess_CycleTimeout_ms=120
  53.    Path_AutoDblQuotes=0
  54.    CmdHistory_MaxItems=256
  55.    Exec_MaxCount=100
  56.    RichEdit_MaxTextLength=4194304
  57.    CommentDelimiter=//
  58.    NoEmptyVars=1
  59.    SaveCmdHistory=1
  60.  
  61.  
  62.  ChildProcess_StartupTimeout_ms
  63.  ------------------------------
  64.    This parameter is important when a child console process is created.
  65.    The child process usually can't be created immediately, therefore
  66.    we must give some time to this process to be started.
  67.    Here is a general implementation of this part of code:
  68.    
  69.        if ( CreateProcess( ... , &ProcInfo ) )
  70.        {
  71.            CloseHandle( ProcInfo.hThread );
  72.            WaitForSingleObject( ProcInfo.hProcess, STARTUP_TIMEOUT );
  73.            ...
  74.        }
  75.  
  76.    When the process is started, WaitForSingleObject returns.
  77.    But, if the value of STARTUP_TIMEOUT is too low, WaitForSingleObject 
  78.    may return before the process is started.
  79.    If default value of ChildProcess_StartupTimeout_ms is not enough for
  80.    your PC, you can increase it. IMHO, it can not exceed 400 ms.
  81.    
  82.  
  83.  ChildProcess_CycleTimeout_ms
  84.  ----------------------------
  85.    The only purpose of this parameter is to decrease the CPU usage.
  86.    The bigger value you set, the less CPU usage you get :-)
  87.    Here is an implementation of this part of code in outline:
  88.    
  89.        do {
  90.            // reading from the process'es pipe
  91.            ...
  92.        } while ( WaitForSingleObject( ProcInfo.hProcess, 
  93.                      CYCLE_TIMEOUT ) == WAIT_TIMEOUT );
  94.    
  95.    Don't forget that actually the value of ChildProcess_CycleTimeout_ms
  96.    is a pause between requests to the child console process'es output, 
  97.    so values > 500 ms are not recommened.
  98.  
  99.  
  100.  Path_AutoDblQuotes
  101.  ------------------
  102.    If you enable this option (set it to 1), then path to executable 
  103.    which contains spaces (for example, "my program 1.exe") will be 
  104.    automatically enclosed in quotes "".
  105.    It is disabled by default because of a bug with executables w/o
  106.    extension. For example, this line
  107.    
  108.      cmd /c calc.exe
  109.    
  110.    will be modified (if this option is enabled) to this one:
  111.    
  112.      "cmd /c calc.exe"
  113.      
  114.    because "cmd" is given without extension ".exe".
  115.    Therefore don't forget to enclose paths with spaces in quotes
  116.    manually, when this option is disabled.
  117.    
  118.  
  119.  CmdHistory_MaxItems
  120.  -------------------
  121.    Specifies maximum number of items in the console commands history.
  122.    
  123.  
  124.  Exec_MaxCount
  125.  -------------
  126.    Specifies maximum number of NPP_EXEC calls within one script.
  127.    This value is needed to prevent the infinite loop of several scripts
  128.    which call each other, e.g.
  129.    
  130.      ::script1
  131.      npp_exec script2
  132.      
  133.      ::script2
  134.      npp_exec script1
  135.    
  136.  
  137.  RichEdit_MaxTextLength  
  138.  ----------------------
  139.    Specifies maximum number of characters which can be stored or 
  140.    pasted into the Console dialog's rich edit control.
  141.  
  142.  
  143.  CommentDelimiter
  144.  ----------------
  145.    Specifies a comment delimiter  :-)  I.e. all characters after
  146.    this delimiter are understood as a comment, and the text line
  147.    (command) is truncated at the position of this delimiter.
  148.    Exception: 
  149.    - when the comment delimiter is // then :// is not truncated 
  150.    at the position of // (because :// can be a part of http://).
  151.    Note:
  152.    - if you specify empty comment delimiter i.e.
  153.  
  154.      CommentDelimiter=
  155.  
  156.    then you can not use comments in your commands/scripts because
  157.    there is no comment delimiter in this case.
  158.  
  159.  
  160.  Visible
  161.  -------
  162.    If you enable this option (set it to 1), then the Console window
  163.    will be visible when Notepad++ starts. Otherwise, when this option
  164.    is set to 0 (default value), there will be no Console window opened
  165.    when Notepad++ starts.
  166.  
  167.  
  168.  NoEmptyVars
  169.  -----------
  170.    When this option is enabled (set to 1), then all unset variables
  171.    such as "$(var)" will be replaced with "" (empty string).
  172.    If this option is disabled (set to 0), then unset variable "$(var)" 
  173.    will not be replaced with empty string i.e. it will remain "$(var)".
  174.  
  175.  
  176.  SaveCmdHistory
  177.  --------------
  178.    When this option is enabled (set to 1) and "Console Commands History"
  179.    is checked, then the console commands history is saved to file
  180.    "npec_cmdhistory.txt" when Notepad++ exits. And the commands history
  181.    is restored from this file when Notepad++ starts.
  182.    If this option is disabled (set to 0), then the console commands
  183.    history is not saved and restored.
  184.  
  185.  
  186.  HotKey
  187.  ------
  188.    Specifies the plugin hotkey which calls the "Execute..." dialog.
  189.    Available values are: F1, F2, F3 ... F12.
  190.  
  191.  
  192.  ToolbarBtn
  193.  ----------
  194.    ToolbarBtn = 0  -  no toolbar button;
  195.    ToolbarBtn = 1  -  the toolbar button shows the Console window;
  196.    ToolbarBtn = 2  -  the toolbar button calls the "Execute..." dialog.
  197.    ToolbarBtn = 3  -  the toolbar button directly executes last script.
  198.    
  199.    
  200.  WatchScriptFile
  201.  ---------------
  202.    When this option is enabled (set to 1), the plugin rereads the file
  203.    with saved scripts if its time stamp has been changed. The plugin
  204.    checks the file time stamp when you call the "Execute..." dialog.
  205.    If this option is disabled (set to 0), the plugin does not check
  206.    the file time stamp and does not reread this file.
  207.  
  208.